package org.rambadger.command.command;

import org.axonframework.commandhandling.annotation.TargetAggregateIdentifier;
import org.hibernate.validator.constraints.Length;
import org.rambadger.command.validation.UrlIdentifier;

import javax.validation.constraints.NotNull;

/**
 * {@link org.rambadger.command.command Command} class for altering {@link org.rambadger.command.model.UserAggregate User} other than email address.
 * @see ChangeUserEmail
 */
public class ChangeUserProfile {
    @TargetAggregateIdentifier
    private final String username;
    private final String firstName;
    private final String lastName;

    /**
     * Instantiates a new ChangeUserProfile command.
     *
     * @param username the username
     * @param firstName the new first name
     * @param lastName the new last name
     */
    public ChangeUserProfile(String username, String firstName, String lastName) {
        this.username = username;
        this.firstName = firstName;
        this.lastName = lastName;
    }

    /**
     * Gets the username.
     *
     * @return the username
     */
    @UrlIdentifier @NotNull
    public String getUsername() {
        return username;
    }

    /**
     * Gets the new first name.
     *
     * @return the new first name
     */
    @Length(max = 32) @NotNull
    public String getFirstName() {
        return firstName;
    }

    /**
     * Gets the new last name.
     *
     * @return the new last name
     */
    @Length(max = 32) @NotNull
    public String getLastName() {
        return lastName;
    }
}
